package mx.netbrain.model;

// Generated Sep 26, 2012 10:26:19 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "netbrain", uniqueConstraints = {
		@UniqueConstraint(columnNames = "username"),
		@UniqueConstraint(columnNames = "mail") })
public class User implements java.io.Serializable {

	private Integer id;
	private Profile profile;
	private Status status;
	private String name;
	private String lastname;
	private String maidenname;
	private String username;
	private String password;
	private String mail;
	private Date register;

	public User() {
	}

	public User(Profile profile, Status status, String name, String lastname,
			String username, String password, String mail, Date register) {
		this.profile = profile;
		this.status = status;
		this.name = name;
		this.lastname = lastname;
		this.username = username;
		this.password = password;
		this.mail = mail;
		this.register = register;
	}

	public User(Profile profile, Status status, String name, String lastname,
			String maidenname, String username, String password, String mail,
			Date register) {
		this.profile = profile;
		this.status = status;
		this.name = name;
		this.lastname = lastname;
		this.maidenname = maidenname;
		this.username = username;
		this.password = password;
		this.mail = mail;
		this.register = register;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "profile", nullable = false)
	public Profile getProfile() {
		return this.profile;
	}

	public void setProfile(Profile profile) {
		this.profile = profile;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "status", nullable = false)
	public Status getStatus() {
		return this.status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "lastname", nullable = false, length = 45)
	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	@Column(name = "maidenname", length = 45)
	public String getMaidenname() {
		return this.maidenname;
	}

	public void setMaidenname(String maidenname) {
		this.maidenname = maidenname;
	}

	@Column(name = "username", unique = true, nullable = false, length = 20)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", nullable = false, length = 100)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "mail", unique = true, nullable = false, length = 70)
	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "register", nullable = false, length = 19)
	public Date getRegister() {
		return this.register;
	}

	public void setRegister(Date register) {
		this.register = register;
	}

}
